package com.hutao.medical.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hutao.medical.common.util.JsonUtils;
import com.hutao.medical.service.BasicService;
@Controller
@RequestMapping("/basicInfo")
public class BasicInfoController {
	
	@Autowired
	private BasicService basicService;

	@PostMapping("/ajaxDiagDieaseJson")
	@ResponseBody
	public String ajaxDiagDieaseJson(String queryName){
		List<Map<String,Object>> diseaseList = basicService.getDiseaseList(queryName);
		return JsonUtils.objectToJson(diseaseList);
	}
	
	
	@PostMapping("/ajaxOperationJson")
	@ResponseBody
	public String ajaxOperationJson(String queryName){
		List<Map<String,Object>> diseaseList = basicService.getOperationList(queryName);
		return JsonUtils.objectToJson(diseaseList);
	}
	
	
	@PostMapping("/ajaxSexNameJson")
	@ResponseBody
	public String ajaxSexNameJson(String queryName) {
	 	List<Map<String,Object>> list = basicService.getSexNameList(queryName);
		return JsonUtils.objectToJson(list);
	}
	
	
	@PostMapping("/ajaxInHospitalStateJson")
	@ResponseBody
	public String ajaxInHospitalStateJson(String queryName) {
	 	List<Map<String,Object>> list = basicService.getInHospitalStateList(queryName);
		return JsonUtils.objectToJson(list);
	}
	
	
	@PostMapping("/ajaxPaymentTypeJson")
	@ResponseBody
	public String ajaxPaymentTypeJson(String queryName) {
	 	List<Map<String,Object>> list = basicService.getPaymentTypeList(queryName);
		return JsonUtils.objectToJson(list);
	}
	
	
	
	@PostMapping("/ajaxDeptNameJson")
	@ResponseBody
	public String ajaxDeptNameJson(String queryName) {
	 	List<Map<String,Object>> list = basicService.getDeptNameList(queryName);
		return JsonUtils.objectToJson(list);
	}
	
	
	@PostMapping("/ajaxOutHospitalTypeJson")
	@ResponseBody
	public String ajaxOutHospitalTypeJson(String queryName) {
	 	List<Map<String,Object>> list = basicService.getOutHospitalTypeList(queryName);
		return JsonUtils.objectToJson(list);
	}
	
	
	
	
}
